﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;


namespace BusinessDll
{
    class CronTimer
    {
        private static DateTime zeroOClock = DateTime.Today.AddHours(0.0);
        private static DateTime oneOClock = DateTime.Today.AddHours(1.0);
        /// <summary>
        /// 初始化Timer控件
        /// </summary>

        public static int getHour() {
            /*DateTime now = DateTime.Now;
            int currentHour = now.Hour;*/
            return DateTime.Now.Hour;
        }
        public static int getMinute()
        {
            /*DateTime now = DateTime.Now;
            int currentHour = now.Hour;*/
            return DateTime.Now.Minute;
        }
        public static void quartz()
        {
            DateTime now = DateTime.Now;
            string datehour = now.ToString("yyyy/MM/dd HH:00:00");
            if (datehour == "1") {
                oneTimerCallback();
            }
        }

        // 回调函数  
        private static void zeroTimerCallback(Object o)
        {
            Console.WriteLine("当前时间：{0}", DateTime.Now);
        }

        // 回调函数  
        private static void oneTimerCallback()
        {
            Console.WriteLine("当前时间：{0}", DateTime.Now);
        }


    }
}
